package com.zyf.controller;


import com.zyf.pojo.Department;
import com.zyf.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController

public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    /*处理加载下拉列表框科室数据的请求*/
    @GetMapping("/initDepartment")
    @CrossOrigin
    public List<Department> initDepartment(){
        return departmentService.list();
    }

}
